<script type="text/javascript">
	$(document).ready(function() {

		$("div.media").find("span.editdata").hide();

		$("div.media").hover(
		  function () {
			$(this).find("span.editdata:first").show();
		  },
		  function () {
			$(this).find("span.editdata:last").hide();
		  }
		);
		 
		//li with fade class
		$("li.fade").hover(function(){$(this).fadeOut(100);$(this).fadeIn(500);});

	});
</script>
<div class="content">
	<?php if( $auth_group == "users" ){ ?>
		<div id="button_Contents" style="float: right;">
			<a href="index.php?pages=news_edit" role="button" class="btn btn-primary"><i class="icon-plus icon-white"></i>&nbsp;เพิ่มข่าวใหม่</a>
		</div>
		<br class="clear-all" />
	<?php } ?>

	<?php
		$sql = "SELECT * FROM web_news WHERE published='0' and pins='0' and user_id='$auth_id' ORDER BY ordering";
		$query = mysql_query( $sql );
		$array = array();
		while ($row1 = mysql_fetch_object( $query )) {
			$array[] = $row1;
		}
		$rows = $array;
		for ($i=0, $n=count( $rows ); $i < $n; $i++) {
			$row = &$rows[$i];
	?>
			<div class="media" style="border-top: 1px solid #e9e8e8;">
			  <a class="pull-left" href="#" style="margin-top:13px;">
				<img class="media-object" src="images/stories/jat.jpg">
			  </a>
			  <div class="media-body">
					<div class="componentheading">
						<div style="float:left;"><?php echo $row->title; ?></div>
						<span class="editdata">
						<?php if( $auth_group == "users" ){ ?>
							<a href="index.php?pages=news_edit&id=<?php echo $row->id; ?>" title="แก้ไข"><i class="icon-pencil"></i></a>&nbsp;
							<a href="#" title="ลบ" id='edit<?php echo $row->id; ?>'><i class="icon-trash"></i></a>&nbsp;&nbsp;
						<?php } ?>
						</span>
						<br class="clear-all" />
						</div>
						<br class="clear-all" />
						<p><?php echo $row->introtexts; ?></p>
			  </div>
			</div>

	<?php } ?>

</div>
<div class="clearfix"></div>
